package com.spt.springbootzhsx.service.suggest.Get_MTMC_mul_UWL_5;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.MultipleInputs;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;

/*
 **@Author:邓少勋
 **Created on 2022-06-10
 */
public class MU_Main {
    public static void domain() throws Exception {
        Configuration conf = new Configuration();

        Job job=Job.getInstance(conf,"电影共现矩阵与用户观影向量相乘");
        job.setJarByClass(MU_Main.class);
       // job.setMapperClass(MU_U_Mapper.class);
        job.setOutputKeyClass(MUbean.class);
        job.setOutputValueClass(Text.class);
        job.setPartitionerClass(MU_Partitioner.class);
        job.setGroupingComparatorClass(MU_Group.class);
        job.setReducerClass(MU_Reducer.class);
        MultipleInputs.addInputPath(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step03/part-r-00000"), TextInputFormat.class,MU_M_Mapper.class);
        MultipleInputs.addInputPath(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step04/part-r-00000"), TextInputFormat.class,MU_U_Mapper.class);


        //FileInputFormat.setInputPaths(job,new Path("C:\\Users\\86147\\Desktop\\rate.txt"));
        //FileOutputFormat.setOutputPath(job,new Path("C:\\Users\\86147\\Desktop\\rateOut\\MUL_5"));
        job.setOutputFormatClass(TextOutputFormat.class);
        TextOutputFormat.setOutputPath(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step05"));
        job.waitForCompletion(true);
    }
}
